package com.activenetwork.smlite.testcase.login;

import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.testng.annotations.Test;

import com.activenetwork.smlite.page.LoginErrorPage;
import com.activenetwork.smlite.testcase.BaseCase;
import com.activenetwork.util.EnvContext;
import com.activenetwork.util.PageLoader;
import com.activenetwork.util.verification.gson.FailurePoint;

public class Login003 extends BaseCase {
	static final Logger logger = LoggerFactory.getLogger(Login003.class);
	
	@Test
	public void Username_text_input_field_email_address_format_validation(){
		// user name does not meet email address format
		loginBusiness.login("mytestname@", "password");
		LoginErrorPage loginErrorPage = PageLoader.load(LoginErrorPage.class);
		if(!StringUtils.equalsIgnoreCase(loginErrorPage.getErrorMsg(), "Username or Password is not correct.")){
			EnvContext.failurePointTL.get().add(new FailurePoint(
					Login003.class.getName(), 
					"Verify user name format", 
					"The error message is not correct."));
		}
		
		loginBusiness.logout();
	}
    

}
